﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace vBooking.UnitTest.DMS
{
    class Advance_Code
    {
        public void CheckIN()
        {
            //var _id = Doc.SafeGet<string>("_id");
            //// 获取当前时间对应的微秒数
            //var _Date = Service.GetDateTotalMilliseconds().ToString();
            //BaseDoc.Set("CheckStatus", "Checked In");
            //BaseDoc.Set("CheckCreator", CurrentUser.StaffName);
            //BaseDoc.Set("CheckCreatorId", CurrentUser.StaffCode);
            //BaseDoc.Set("CheckTime", _Date);
            //var result = Service.CreateDocument(BaseDoc, _id, "Document");
            //if (result > 0)
            //{
            //    Return.MsgContent = "Action Complete.";
            //}
            //else
            //{
            //    Return.MsgContent = "System error.";
            //}

            //Return.ReturnUrl = Service.RedirectUrl(_id);
            //return Return;
        }

        public void Save()
        {
            //var _id = Doc.SafeGet<string>("_id");
            //var result = Service.CreateDocument(BaseDoc, _id, "Document");
            //if (result > 0)
            //{
            //    Return.MsgContent = "Action Complete.";
            //}
            //else
            //{
            //    Return.MsgContent = "System error.";
            //}
            //var checkStatus = Doc.SafeGet<string>("CheckStatus");
            //if (checkStatus == "Checked Out")
            //{
            //    Return.ReturnUrl = "/dlcmstestdrive/dlcms/vForm/Document/Edit/" + _id;
            //}
            //else
            //{
            //    Return.ReturnUrl = "/dlcmstestdrive/dlcms/vForm/Document/Preview/" + _id;
            //}
            //return Return;
        }
    }
}
